/*
 * Copyright 2000-2020 ALPHA LAB.Inc All Rights Reserved.
 */
package com.alphalab.moonlight.demo.impl.role;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 
import com.alphalab.framework.role.GeneralQueryRole; 
import com.alphalab.moonlight.demo.dao.model.AirlineFlight;
import com.alphalab.moonlight.demo.dao.service.IAirlineFlightQueryDao; 
import com.alphalab.moonlight.demo.impl.trans.AirlineFlightTransfer; 
import com.alphalab.moonlight.demo.service.model.AirlineFlightVO; 
import com.alphalab.moonlight.demo.service.role.IAirlineFlightQueryRole; 

/**
 * AirlineFlightQueryRole.
 * @author allen 
 * @version 1.0.0 2018年3月6日
 */
@Service 
@Transactional
public class AirlineFlightQueryRole extends GeneralQueryRole<AirlineFlightVO, AirlineFlight, IAirlineFlightQueryDao, 
	AirlineFlightTransfer> implements IAirlineFlightQueryRole  {

	/**
	 * 初始化时注入airlineFlightQueryDao到AirlineFlightQueryRole中.
	 * @param airlineFlightQueryDao airlineFlightQueryDao
	 */  
	@Autowired
	public void setAirlineFlightQueryDao(final IAirlineFlightQueryDao airlineFlightQueryDao) {
		super.setGeneralQueryDao(airlineFlightQueryDao);
	}
	
	/**
	 * 手动new一个转换器并set到父类中.
	 */
	@Override
	public AirlineFlightTransfer getEntityTransfer() {
		try {
			return super.getEntityTransfer();
		} catch (RuntimeException e) { 
			super.setEntityTransfer(new AirlineFlightTransfer());
		}
		return super.getEntityTransfer();
	}	 
	
}
